/*
 * Wireless_Uart.h
 *
 *  Created on: Aug 30, 2016
 *      Author: yzz
 */

#ifndef WIRELESS_UART_H_
#define WIRELESS_UART_H_

#include "stm32f4xx_hal.h"
#include "peripherals/peripherals.h"

#define Console_Buff_LEN 150

#define Console_RxState_Clear \
do{\
    Console_RX.Len = 0;\
    Console_RX.State = 0;\
    HAL_UART_Receive_DMA(&huart1, Console_RX.Data + Console_RX.Len, Console_Buff_LEN);  \
}while(0)



typedef struct Console_Rx_Data
{
    uint8_t Len;
    uint8_t State;
    uint8_t Data[Console_Buff_LEN];
} Rx_Data;

extern Rx_Data Console_RX;



typedef struct Robot_Rx
{
	uint32_t speed_time;
	uint8_t flag_pwm;
} speed_time;

extern speed_time pwm_time;

void Console_Task_Init(void);
void Console_IRQ(void);


#endif /* WIRELESS_UART_H_ */
